home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_test2.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  68 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_test2.cog    ThingLightAnim test.
  4. #
  5. # [GGJ]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message     activated
  13. message     startup
  14.  
  15. thing       torch                //the thing you light
  16. thing       flame    nolink        //flame, hidden at startup
  17. thing        dynalite            //dynamic light (to control where light is cast)
  18. thing        otherthing            //item that gets highlighted
  19.  
  20. sound       burning=gen_torch_burnin_c.wav  local
  21.  
  22. vector      minlite        local
  23. vector      maxlite        local
  24.  
  25. flex        minradius=0.3    local
  26. flex        maxradius=0.3    local
  27.             
  28. flex        reach=0                        //0 for medium, 1 for high
  29. flex        islit=0            local        //set to 1 if torch lights at startup
  30. flex        flicker=1                    //set to 0 to eliminate flicker
  31. end
  32.  
  33. # ========================================================================================
  34. code
  35.  
  36. startup:
  37.     player = GetLocalPlayerThing();
  38.     minlite = VectorSet(0.87, 0.55, 0.06);
  39.     maxlite = VectorSet(0.89, 0.64, 0.30);    
  40.     SetThingFlags(flame, 0x10);
  41.     SetThingLight(torch, VectorSet(0.0, 0.0, 0.0), 0.3, 0.1);
  42.     return;
  43. # ........................................................................................
  44. activated:
  45.     if (islit) return;
  46.     if ((GetCurWeapon(player) != 13) && (!InEditor())) return;
  47.     
  48.     PlayMode(player, (60 + reach), 0);
  49.     Sleep(0.5);        //no return, falls through to lightit
  50.  
  51.     ClearThingFlags(flame, 0x10);
  52.     SetThingLight(torch, minlite, 0.3, 0.5);                           
  53.     SetThingLight(dynalite, minlite, 0.3, 0.5);
  54.     if (otherthing)
  55.     {
  56.         SetThingLight(otherthing, minlite, 0.01, 0.5);
  57.     }
  58.         
  59.     Sleep(0.5);
  60.  
  61.     PlaySoundThing(burning, torch, 1, 3, 10, 1);
  62.     islit = 1;
  63.     
  64.     if (flicker == 0) return;
  65.     ThingLightAnim(torch, minlite, minradius, maxlite, maxradius, 2);
  66.     return;
  67.         
  68. end